package com.neutech.service.impl;
import com.neutech.mapper.DepartmentMapper;
import com.neutech.mapper.DoctorMapper;
import com.neutech.service.DepartmentService;
import com.neutech.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public  class DepartmentServiceImpl implements DepartmentService {
    @Autowired
    private DepartmentMapper departmentMapper;
    @Override
    public List<Map<String, Object>> queryDepartment() {
        List<Map<String, Object>> list = departmentMapper.queryDepartmentList(0);
        return list;
    }
    @Override
    public void insertDepartment(Map map){
        Integer a = departmentMapper.addDepartment(map);

    }
    public void updataDepartment(Map map){
        departmentMapper.updataDepartmentById(map);
    }
    public void deleteDepartment(Map map){
       // doctorMapper.delDoctorById(map);
//        System.out.println(map.get("docid"));
//        System.out.println("kanzheli");
        Integer depid= Integer.valueOf(map.get("depid").toString());
        departmentMapper.delDepartmentById(depid);
    }
}
